package com.yaodian100.crm.activities.entity;

import java.io.Serializable;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.CollectionOfElements;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

/**
 * @author yanling.wu
 */
@Entity
@Table(name = "crm_mgm")
public class Mgm implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String id;
	private String memberId;
	// 礼券号
	private String couponId;

	private Map<String, MgmValue> mgmValue;

	/**
	 * @return the id
	 */
	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(length = 32)
	public String getId() {
		return id;
	}

	/**
	 * @param atValue the id to set
	 */
	public void setId(String id) {
		this.id = id;
	}

	/**
	 * @return the memberId
	 */
	@Column(length = 10)
	public String getMemberId() {
		return memberId;
	}

	/**
	 * @param id the memberId to set
	 */
	public void setMemberId(String memberId) {
		this.memberId = memberId;
	}

	/**
	 * @return the couponId
	 */
	@Column(length = 10)
	public String getCouponId() {
		return couponId;
	}

	/**
	 * @param id the couponId to set
	 */
	public void setCouponId(String couponId) {
		this.couponId = couponId;
	}

	/**
	 * @return the mgmValue
	 */
	@org.hibernate.annotations.MapKey(columns = { @Column(name = "name") })
	@OneToMany(mappedBy = "mgm")
	@CollectionOfElements(targetElement = MgmValue.class)
	@LazyCollection(LazyCollectionOption.FALSE)
	public Map<String, MgmValue> getMgmValue() {
		return mgmValue;
	}

	/**
	 * @param atValue the mgmValue to set
	 */
	public void setMgmValue(Map<String, MgmValue> mgmValue) {
		this.mgmValue = mgmValue;
	}

}
